Micron Document
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| SparkN0de-git | SparkN0de |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Displaying Raw • Download


docs/source/examples.rst ec8d43a548017de41cdf73e7e3eb9844a5d349cd (ec8d43a5) Text, 4.22 KB

Tb4b4b4.. Tff7b72_examples-main:

Tc9d1d9*************
Tc9d1d9Code Examples
Tc9d1d9*************

A number of examples are included in the source distribution of Reticulum. You can use these examples to learn how to write your own programs.

Tb4b4b4.. Tff7b72_example-minimal:

Tc9d1d9Minimal
Tc9d1d9=======

The *Minimal* example demonstrates the bare-minimum setup required to connect to a Reticulum network from your program. In about five lines of code, you will have the Reticulum Network Stack initialised, and ready to pass traffic in your program.

Tb4b4b4.. Tff7b72literalincludeTb4b4b4:: ../../Examples/Minimal.py

This example can also be found at Ta5d6ff`<https://github.com/markqvist/Reticulum/blob/master/Examples/Minimal.py>`_.

Tb4b4b4.. Tff7b72_example-announce:

Tc9d1d9Announce
Tc9d1d9========

The *Announce* example builds upon the previous example by exploring how to announce a destination on the network, and how to let your program receive notifications about announces from relevant destinations.

Tb4b4b4.. Tff7b72literalincludeTb4b4b4:: ../../Examples/Announce.py

This example can also be found at Ta5d6ff`<https://github.com/markqvist/Reticulum/blob/master/Examples/Announce.py>`_.

Tb4b4b4.. Tff7b72_example-broadcast:

Tc9d1d9Broadcast
Tc9d1d9=========
The *Broadcast* example explores how to transmit plaintext broadcast messages over the network.

Tb4b4b4.. Tff7b72literalincludeTb4b4b4:: ../../Examples/Broadcast.py

This example can also be found at Ta5d6ff`<https://github.com/markqvist/Reticulum/blob/master/Examples/Broadcast.py>`_.

Tb4b4b4.. Tff7b72_example-echo:

Tc9d1d9Echo
Tc9d1d9====

The *Echo* example demonstrates communication between two destinations using the Packet interface.

Tb4b4b4.. Tff7b72literalincludeTb4b4b4:: ../../Examples/Echo.py

This example can also be found at Ta5d6ff`<https://github.com/markqvist/Reticulum/blob/master/Examples/Echo.py>`_.

Tb4b4b4.. Tff7b72_example-link:

Tc9d1d9Link
Tc9d1d9====

The *Link* example explores establishing an encrypted link to a remote destination, and passing traffic back and forth over the link.

Tb4b4b4.. Tff7b72literalincludeTb4b4b4:: ../../Examples/Link.py

This example can also be found at Ta5d6ff`<https://github.com/markqvist/Reticulum/blob/master/Examples/Link.py>`_.

Tb4b4b4.. Tff7b72_example-identify:

Tc9d1d9Identification
Tc9d1d9==============

The *Identify* example explores identifying an intiator of a link, once the link has been established.

Tb4b4b4.. Tff7b72literalincludeTb4b4b4:: ../../Examples/Identify.py

This example can also be found at Ta5d6ff`<https://github.com/markqvist/Reticulum/blob/master/Examples/Identify.py>`_.

Tb4b4b4.. Tff7b72_example-request:

Tc9d1d9Requests & Responses
Tc9d1d9====================

The *Request* example explores sending requests and receiving responses.

Tb4b4b4.. Tff7b72literalincludeTb4b4b4:: ../../Examples/Request.py

This example can also be found at Ta5d6ff`<https://github.com/markqvist/Reticulum/blob/master/Examples/Request.py>`_.

Tb4b4b4.. Tff7b72_example-channel:

Tc9d1d9Channel
Tc9d1d9=======

The *Channel* example explores using a Ta5d6ff``Ta5d6ffChannelTa5d6ff`` to send structured data between peers of a Ta5d6ff``Ta5d6ffLinkTa5d6ff``.

Tb4b4b4.. Tff7b72literalincludeTb4b4b4:: ../../Examples/Channel.py

This example can also be found at Ta5d6ff`<https://github.com/markqvist/Reticulum/blob/master/Examples/Channel.py>`_.

Tc9d1d9Buffer
Tc9d1d9======

The *Buffer* example explores using buffered readers and writers to send binary data between peers of a Ta5d6ff``Ta5d6ffLinkTa5d6ff``.

Tb4b4b4.. Tff7b72literalincludeTb4b4b4:: ../../Examples/Buffer.py

This example can also be found at Ta5d6ff`<https://github.com/markqvist/Reticulum/blob/master/Examples/Buffer.py>`_.

Tb4b4b4.. Tff7b72_example-filetransfer:

Tc9d1d9Filetransfer
Tc9d1d9============

The *Filetransfer* example implements a basic file-server program that allow clients to connect and download files. The program uses the Resource interface to efficiently pass files of any size over a Reticulum Te6edf3:ref:Te6edf3`Link<api-link>`.

Tb4b4b4.. Tff7b72literalincludeTb4b4b4:: ../../Examples/Filetransfer.py

This example can also be found at Ta5d6ff`<https://github.com/markqvist/Reticulum/blob/master/Examples/Filetransfer.py>`_.

Tb4b4b4.. Tff7b72_example-custominterface:

Tc9d1d9Custom Interfaces
Tc9d1d9=================

The *ExampleInterface* demonstrates creating custom interfaces for Reticulum. Any number of custom interfaces can be loaded and utilised by Reticulum, and will be fully on-par with natively included interfaces, including all supported Te6edf3:ref:Te6edf3`interface modes<interfaces-modes>` and Te6edf3:ref:Te6edf3`common configuration options<interfaces-options>`.

Tb4b4b4.. Tff7b72literalincludeTb4b4b4:: ../../Examples/ExampleInterface.py

This example can also be found at Ta5d6ff`<https://github.com/markqvist/Reticulum/blob/master/Examples/ExampleInterface.py>`_.


──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────